#ifndef CONFIG_H_H_H
#define CONFIG_H_H_H

#include <string>
#include <vector>
using std::string;
using std::vector;

#include "Struct.h"
#include "tinyxml.h"

class Config {
public:
	~Config() {}
	static Config* Instance();
	void Init(const string&);
	const vector<int>& GetVecNum() { return m_vecNum; }
	const PropInsertion& GetPropInsertion() { return m_insertion; }
	const PropSelection& GetPropSelection() { return m_selection; }
	const PropSwap& GetPropSwap() { return m_swap; }
	const PropMerge& GetPropMerge() { return m_merge; }
	
private:
	Config() : m_init(0) {}
	bool ReadConfig();
	bool InitVecNum(TiXmlElement*);	
	bool InitInsertion(TiXmlElement*);
	bool InitSelection(TiXmlElement*);
	bool InitSwap(TiXmlElement*);
	bool InitMerge(TiXmlElement*);				

private:
	static Config* m_instance;
	string m_configFile;
	int m_init;	

	vector<int> m_vecNum;
	PropInsertion m_insertion;		
	PropSelection m_selection;
	PropSwap m_swap;
	PropMerge m_merge;			
};

#endif
